<template>
  <div>
    <el-form :model="form" label-width="180px">
      <el-form-item label="用药种类">
        <el-select v-model="form.medicationType" placeholder="请选择">
          <el-option label="溴吡斯的明" value="1" />
          <el-option label="醋酸泼尼松" value="2" />
          <el-option label="美卓乐" value="3" />
          <el-option label="硫唑嘌呤" value="4" />
          <el-option label="他克莫司" value="5" />
          <el-option label="环孢素A" value="6" />
          <el-option label="吗替麦考酚酯" value="7" />
          <el-option label="甲氨蝶呤" value="8" />
          <el-option label="环磷酰胺" value="9" />
          <el-option label="利妥昔单抗" value="10" />
        </el-select>
      </el-form-item>
      <el-form-item label="溴吡斯的明日剂量">
        <el-input v-model="form.dose" />
      </el-form-item>
      <el-form-item label="溴吡斯的明术前使用时间">
        <el-date-picker
          v-model="form.preoperativeUseTime"
          type="date"
          placeholder="选择日期"
        />
      </el-form-item>
      <el-form-item label="免疫抑制剂:">
        <el-checkbox-group v-model="form.immunosuppressive" @change="handleImmunosuppressive">
          <el-checkbox label="1" name="immunosuppressive">利妥昔单抗</el-checkbox>
          <el-checkbox label="2" name="immunosuppressive">醋酸泼尼松</el-checkbox>
          <el-checkbox label="3" name="immunosuppressive">甲泼尼龙</el-checkbox>
          <el-checkbox label="4" name="immunosuppressive">硫唑嘌呤</el-checkbox>
          <el-checkbox label="5" name="immunosuppressive">他克莫司</el-checkbox>
          <el-checkbox label="6" name="immunosuppressive">环孢素A</el-checkbox>
          <el-checkbox label="7" name="immunosuppressive">吗替麦考酚酯</el-checkbox>
          <el-checkbox label="8" name="immunosuppressive">甲氨蝶呤</el-checkbox>
          <el-checkbox label="9" name="immunosuppressive">环磷酰胺</el-checkbox>
        </el-checkbox-group>
      </el-form-item>
      <immunosuppressive-detail
        v-for="item in titles"
        :key="item.id"
        :title="item.title"
        :show="isShow(item.id)"
      />
    </el-form>
  </div>
</template>

<script>
import immunosuppressiveDetail from './immunosuppressiveDetail.vue'
export default {
  components: {
    immunosuppressiveDetail
  },
  data() {
    return {
      form: {
        immunosuppressive: [],
        medicationType: '1',
        preoperativeUseTime: '',
        dose: ''
      },
      titles: [
        {
          id: '1',
          title: '利妥昔单抗剂量（mg）'
        }, {
          id: '2',
          title: '醋酸泼尼松剂量（mg）'
        }, {
          id: '3',
          title: '甲泼尼龙剂量（mg）'
        }, {
          id: '4',
          title: '硫唑嘌呤剂量（mg）'
        }, {
          id: '5',
          title: '他克莫司剂量（mg）'
        }, {
          id: '6',
          title: '环孢素A剂量（mg）'
        }, {
          id: '7',
          title: '吗替麦考酚酯剂量（mg）'
        }, {
          id: '8',
          title: '甲氨蝶呤剂量（mg）'
        }, {
          id: '9',
          title: '环磷酰胺剂量（mg）'
        }
      ],
      immunosuppressiveValue: []
    }
  },
  methods: {
    onSubmit() {
      console.log(this.form)
    },
    handleImmunosuppressive(v) {
      this.immunosuppressiveValue = v
    },
    isShow(key) {
      return this.immunosuppressiveValue.indexOf(key) !== -1
    }
  }
}
</script>

<style>

</style>
